from django.db import models


# Create your models here.
class Menu(models.Model):
    class Meta:
        db_table = 'MENU'

    # id
    id = models.AutoField(primary_key=True)

    # 功能code
    code = models.CharField(max_length=64)

    # 功能名称
    name = models.CharField(max_length=64)

    # 说明
    content = models.CharField(max_length=255)

    # 开启状态[0：开启、1：关闭]
    enable = models.IntegerField()

    # 删除标识[0：未删除、1：已删除]
    del_flag = models.IntegerField()

    # 创建人
    creator = models.CharField(max_length=20)

    # 修改人
    modifier = models.CharField(max_length=20)

    # 创建时间
    created = models.DateTimeField(auto_now_add=True)

    # 修改时间
    modified = models.DateTimeField(auto_now=True)

    def all(self):
        return ['id', 'code', 'name', 'content', 'enable', 'del_flag', 'creator', 'modifier', 'created', 'modified']
